<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Regular Expression</title>
<usergroup>0</usergroup>
<usergroup_edit>30</usergroup_edit>
<menuaktiv>1</menuaktiv>   
<overwrite>1</overwrite>  
<title_active>1</title_active>  
<parent_url>/admin</parent_url> 
<url>/admin/regular-expression</url>    
<template>admin.html</template> 
</head>
<body>

<form action="" method="post">
<label>Url</label><input name="url" value="[post:url]">
<label>Text</label><textarea name="text" cols="10" rows="10">[post:text]</textarea>
<label>Regular Expression</label><textarea name="re" cols="30" rows="4">[post:re]</textarea>

<input type="submit">
</form>



<?php
    
    if (isset($_REQUEST['text'])) {
        
        $text = $_REQUEST['text'];
        $re = trim($_REQUEST['re']);
        $url = trim($_REQUEST['url']);
        
        // falls Url angegeben
        if ($url !== "") {
            $text = http::get($url);
            
        }
        
        
        
        
        //print_r(regex::getRegexTable($re, $text));
        
        //echo "--------------------";
        
        echo '<table border="1">';
        
        foreach (regex::getRegexTable($re, $text) as $regex) {
  
            echo "<tr>";
            for ($n=1; $n<sizeof($regex); $n++) {
                echo "<td>{$regex[$n]}</td>";
            }
            
            echo "</tr>";
            //print_r($regex);
            
            
        
        }  
         echo "</table>";          
        
        
    }
    
    
    
    
?>










</body>
</html>